Skip to content

Conversation

@PratiAmalden
Copy link

@PratiAmalden PratiAmalden commented Aug 6, 2025

Learners, PR Template

Self checklist

  • I have committed my files one by one, on purpose, and for a reason
  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • I have tested my changes
  • My changes follow the style guide
  • My changes meet the requirements of this task

Changelist

Briefly explain your PR.

Questions

Ask any questions you have for your reviewer.

@PratiAmalden PratiAmalden added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Aug 6, 2025
@LonMcGregor LonMcGregor added the Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. label Aug 19, 2025
Copy link

@LonMcGregor LonMcGregor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, Great work on these implementations so far. I can see a few areas where you could improve further. I've left comments as pointers

# Gets all file names (including hidden ones)
files = os.listdir(args.dir)
except (FileNotFoundError, NotADirectoryError) as err:
print(f"ls: can't access: '{args.dir}': {err}")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is good that you are handling errors. Here you are handling a NotADirectoryError. What happens if you try to use the original ls application with a regular file?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a few questions to ask about this file:

  • Why are you making extra variables for lines, words, etc which are the same as the values in the args dictionary?
  • Can you see what happens in your program if you try to combine multiple arguments in one command?
  • Can you see where there is duplication that could be reduced?

@LonMcGregor LonMcGregor added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Aug 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Reviewed Volunteer to add when completing a review with trainee action still to take.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants